<?php

class MainTask extends \Phalcon\Cli\Task
{
	public function mainAction() {
		echo "\nThis is the default task and the default action \n";
	}

	public function createUserAction(array $params) {
		$usersModel = new UsersModel();

		try {
			$usersModel->name = $params[0];
			$usersModel->gender = $params[1];
			$usersModel->job = $params[2];
			$usersModel->save();
			die('YAY!! ' . $this->db->affectedRows() . ' user added!');
		} catch (DbException $e) {
			die('Oops... something wrong here...->_->' . $e->getMessage());
		}
	}
}